<?php

	require ("class.mcItem.php");
	require ("class.metacritic.php");
	require ("class.metacriticGameSearch.php");
	require ('config.php');
	require ('proxy.php');
	
	global $proxy;
	if (isset($_GET['probe'])){
		if (!isset($_GET['plats']))
			$_GET['plats'] = "all";
		
		$mc = new metacriticGameSearch();
		$mc->useProxy(true);
		if (preg_match('/mrmime/',$_SERVER['HTTP_HOST'])){
			$mc->useProxy(false);
		}
		$mc->setProxy($proxy);
		$mc->setBaseUrl($metaCriticBaseUrl);
		$mc->setPlatformsSupport($platforms);
		$mc->setSheetUrl($metaCriticBaseSheetUrl);
		$mc->setCoverUrl($metaCriticBaseCoverUrl);
			
		$mc->setProbe($_GET['probe']);
		$mc->setPlatform($_GET['plats']);
		$mc->getPage();
		$mc->parseCode();
		
		echo $mc->renderXML();
	}

?>